<template>
    <van-nav-bar title="分销成员" left-text="" left-arrow @click-left="goBack" />

	<div class="clear"></div>
    <div class="h50"></div>
	<div class="retailmember">
		<div v-for="(retailmember, index) in retailmemberList" :key="index" class="item">
            <div class="left">
                <div class="img">
                    <img :src="retailmember.avatar_text" alt="">
                </div>
                <div class="content">
                    <div class="nickname">{{retailmember.nickname}}</div>
                    <div class="tel">{{retailmember.mobile}}</div>
                </div>
            </div>
            <div class="right">{{ retailmember.createTime_text }}</div>
        </div>
	</div>

</template>

<script setup>
import { onBeforeMount } from 'vue';


const { proxy } = getCurrentInstance();
const goBack = () => { proxy.$router.push('/business/index') }
const LoginUser = reactive(proxy.$cookies.get('LoginUser') ?? {});
const retailmemberList = ref([]);

const retailmembers = async () => {
    let result = await Api.retailmember({busid: LoginUser.id});
    if(result.code == 1) {
        retailmemberList.value = result.data.list;
    }
}

onBeforeMount(() => {
    retailmembers();
});

</script>

<style scoped>

.retailmember{
    padding: 15px;
    background: #f5f5f5;
}

.retailmember .item{
    background-color: #fff;
    display: flex;
    justify-content:space-between;
    align-items:center;
    padding: 10px;
    border-radius:5px;
    margin-bottom: 10px;
}

.retailmember .item .left{
    display: flex;
    justify-content: center;
    align-items: center;
}

.retailmember .item .left .img{
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
}

.retailmember .item .left .img img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.retailmember .item .left .content{
    margin-left:10px;
}

.retailmember .item .left .content .nickname{
    color: #323233;
    font-size: 14px;
    font-weight: bold;
}

.retailmember .item .left .content .tel{
    font-size: 12px;
    color: #999;
}

.retailmember .item .right{
    font-size: 12px;
    line-height: 24px;
    color: #333
}

</style>